package UserInterface;

import AirportInfomations.AirportInfo;
import FlightInfo.FlightStatus;
import FlightInfo.Flights;
import InterfacesAndModules.PilotInterface;
import NewAirportInfo.AirportBasicInfo;

import java.util.ArrayList;
import java.util.Scanner;

public class UserIsPilot {
    public final void UserIsPilot(ArrayList<AirportBasicInfo>Airport, ArrayList<Flights>AllOfFlights, ArrayList<FlightStatus>AllOfFlightStatus) {
        Scanner PilotInput = new Scanner(System.in);
        UserInputIsSure IsSure = new UserInputIsSure();
        PilotInterface PilotInterface = new PilotInterface();
        boolean UselessThing = true;

        while (UselessThing) {
            System.out.println("Log：BasicUser Login via Pilot");
            System.out.println("亲爱的飞行员，欢迎使用此系统！");
            System.out.println("请输入您想要做什么");
            System.out.println("1.填写飞行计划    2.查询航班  3.机场信息  4.退出模块");
            int PilotChoice = PilotInput.nextInt();
            PilotChoice = IsSure.UsingCorrectNumInputIsCorrect(1, 3, PilotChoice);
            switch (PilotChoice) {
                case 1:
                    PilotInterface.FlightPlainFillModule(Airport, AllOfFlights,AllOfFlightStatus);
                    /*待开发*/
                    break;
                case 2:
                    int FlightID;
                    System.out.println("请输入要查询的航班ＩＤ");
                    FlightID = PilotInput.nextInt();
                    PilotInterface.FightInfoModule(Airport,AllOfFlights,AllOfFlightStatus,FlightID);
                    break;
                case 3:PilotInterface.PilotGetAirportInfoGet(Airport);
                    break;
                    case 4:UselessThing = false;
                        return;
            }
        }
    }
}
